<?php
class Account_Form_Account_Update extends Zend_Form
{

	public function __construct(Zend_Controller_Action $controller)
	{
		//account_fullname
		$account_fullname = $this->createElement ( 'text', 'account_fullname' )->setLabel ( "Họ tên" )->setRequired ( true )->setAttribs ( array (
			'class' => 'input_text' 
		) );
		
		$account_title = $this->createElement ( 'select', 'account_title' )->setLabel ( "Danh xưng" )->setMultiOptions ( array (
			"" => "- Chọn -" 
		) + Zend_Registry::get ( 'account' )->account_title->toArray () );
		
		/*
		$account_nation = $this->createElement ( 'select', 'account_nation' )->setLabel ( "Quốc gia" )->setMultiOptions ( array (
			"" => "- Chọn -" 
		) + Zend_Registry::get ( 'account' )->account_nation->toArray () );
		*/
		
		$account_city = $this->createElement ( 'select', 'account_city' )->setLabel ( "Tỉnh / thành phố" )->setMultiOptions ( array (
			"" => "- Chọn -" 
		) + Zend_Registry::get ( 'account' )->account_city->toArray () );
		
		$account_district = $this->createElement ( 'select', 'account_district' )->setLabel ( "Quận / huyện" )->setMultiOptions ( array (
			"" => "- Chọn -" 
		) + Zend_Registry::get ( 'account' )->account_district->toArray () );
		
		$account_address = $this->createElement ( 'text', 'account_address' )->setLabel ( "Địa chỉ" )->setAttribs ( array (
			'class' => 'input_text' 
		) );
		
		$account_desk_phone = $this->createElement ( 'text', 'account_desk_phone' )->setLabel ( "SĐT bàn" )->setAttribs ( array (
			'class' => 'input_text' 
		) );
		
		$account_phone = $this->createElement ( 'text', 'account_phone' )->setLabel ( "SĐT di động" )->setAttribs ( array (
			'class' => 'input_text' 
		) );
		
		$account_username = $this->createElement ( 'text', 'account_username' )->setLabel ( "Tài khoản" )->setAttrib ( 'class', 'lock' );
		
		$account_birthday_time = new ZendX_JQuery_Form_Element_DatePicker ( 'account_birthday_time' );
		$account_birthday_time
		->setLabel ( "Ngày sinh" )
		->setAttribs(array("from_year"=>1930,"to_year"=>date("Y")-16,"default_time"=>mktime(1,1,1985)))
		;		
		
		$account_position = $this->createElement ( 'text', 'account_position' )->setLabel ( "Chức vụ" )->setRequired ( false );
		
		$this->addElements ( array (
			$account_username, $account_password, $account_repassword, $account_title, $account_fullname, $account_birthday_time, /* $account_nation, */ $account_city, $account_district, $account_address, $account_phone, $account_desk_phone,$account_position 
		) );
		$controller->getHelper ( "common" )->form ( $this );
	}
}